<%@page import="enterprises.Enterprise"%>
<%@page import="org.codehaus.groovy.grails.web.context.ServletContextHolder"%>
<%=packageName%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <title>Enterprise details</title>
    </head>
    <body>
        <div class="nav">
            <span class="menuButton"><a class="list" href="${createLink(controller:"typeConsumer", action:"list")}"/>TypeConsumer List</a></span>          
        </div>
        
        <div class="body">
        <h1>Enterprises and productions by consumer type: ${typeConsumer} </h1>        	                		
        	<div class="list">
                <table>
                    <thead>
                        <tr>
                        	<th>Enterprise</th>
                        	<th>Product</th>                        																							
                        </tr>
                    </thead>
                    <tbody>
                    <g:each in="${enterprises}" status="i" var="${enterprise}">
                        <tr class="\${(i % 2) == 0 ? 'odd' : 'even'}">
                        	<td>${enterprise.name}</td>
                        	<td>
                        	<table>
                        	<g:each in="${enterprise.productions}" var="${production}">                        	
                        		<tr>
                        			<td>${production.name}</td>
                        		</tr>
                        	</g:each>
                        	</table>
                        	</td>						 					
                        </tr>
                    </g:each>
                    </tbody>
                </table>               
            </div>
        			
        </div>
                
    </body>
</html>
